package com.example;

import com.example.bean.Product;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan(basePackages = "com.example.bean")

public class AppConfig {
    @Bean
    public Product p1(){
        Product p=new Product();
        p.setId(1001);
        p.setPname("张三");
        p.setPrice(100);
        return p;
    }
}
